package edt;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class RemoveListener implements ActionListener {

	
	MySchedulerModel model;
	MyScheduler scheduler;

	
	public RemoveListener(MyScheduler scheduler, MySchedulerModel theModel) {
		this.scheduler=scheduler;
		model = theModel;
	}

	@Override
	public void actionPerformed(ActionEvent arg0) {
		  System.out.println(scheduler.currentAppointment.getTitle());
		  model.removeAppointment(scheduler.currentAppointment);
		  if (scheduler.currentAppointment.isAlreadySync()) {
			  model.addEventsToDelete(scheduler.currentAppointment);
		  }
		 }

}
